<?php
/**
 *  PHP Template
 *
 * @author: ZDW
 * @date: 2016-08-08
 * @version: $Id$
 */

namespace App\Repositories;

use App\Models\CompanyComment;

class CompanyCommentRepository
{
    use BaseRepository;

    private $model;

    public function __construct(CompanyComment $model)
    {
        $this->model = $model;
    }

    /**
     * store.
     *
     * @param array $input
     */
    public function store($input)
    {
        return $this->savePost($this->model, $input);
    }

    /**
     * save.
     *
     * @param Request $input 输入
     */
    public function savePost($events, $input)
    {
        $events->fill($input);
        $events->save();

        return $events;

    }

    /**
     * 更新
     * @param int $id
     * @param $input
     * @return mixed
     */
    public function update($id, $input)
    {
        $model = $this->model->find($id);

        return $this->savePost($model, $input);
    }


    public function getByIds($ids)
    {
        return $this->model->whereIn('invite_id',$ids)->get();
    }
}